1. Field of the Invention
The present invention relates to a motion vector detection device used in a motion compensation/estimation encoding method, which is a type of method used for compressing/encoding digital motion picture data.
2. Description of the Related Art
A motion picture encoding method uses information (motion vector) which indicates the movement of a portion of the current image from the previous image so as to reduce the redundancy in time and quantity of data. The block matching method is a method for extracting such a motion vector.
FIG. 7 illustrates the principle of the block matching method. The image of an object frame 702 to be encoded is compared with the image of a search frame 701 so as to extract a block (best match block 706) from a search region 704 in the search frame 701 that has an evaluation value indicating the highest degree of similarity to an encoded object block 703 (the term xe2x80x9cencoded object blockxe2x80x9d as used herein refers to a block to be encoded, not a block which has already been encoded) in the object frame 702, thereby detecting a motion vector 705 therebetween. The block matching method has been widely used for motion compensation/estimation in image compression/encoding methods.
FIG. 8 illustrates an enlarged version of the search frame 701 shown in FIG. 7. In the block matching method, the degree of correlation is calculated between the single encoded object block 703 and each of a plurality of candidate blocks 707 within the search region 704 in the search frame 701 (the plurality of candidate blocks 707 are selected by scanning the search region 704 vertically or horizontally). Then, one of the candidate blocks 707 having the highest degree of correlation with respect to the encoded object block 703 is selected as the best match block 706, and the motion vector 705 is detected which extends from the position of the block 703 to the best match block 706.
Some conventional motion vector detection devices which are based on the block matching method aim to reduce the amount of hardware resource needed.
Japanese Laid-Open Publication No. 6-141304, for example, discloses a technique in which Mxc3x97N calculation units are arranged in M rows and N columns, each calculation unit including a pixel storage register, a multiplexer and a differential absolute value calculator. Where the reference block size is Mxc3x97N pixels, a candidate vector having the highest degree of correlation with respect to the encoded object block is determined for each of Mxc3x97N candidate blocks. However, with this conventional technique, the degree of correlation can be calculated only for the Mxc3x97N candidate blocks, and it is difficult to increase the number of candidate blocks by expanding the search region in order to select a candidate block which may have a higher degree of correlation with respect to encoded object block.
Japanese Laid-Open Publication No. 9-224249, for example, discloses a motion vector detection device 900 as illustrated in FIG. 9. The motion vector detection device 900 includes two different motion vector detection circuits for detecting two vectors for a given encoded object block, i.e., a first motion vector detection circuit 915 for performing a motion vector detection operation over a relatively large detection region but with a relatively coarse resolution and a second motion vector detection circuit 916 for performing a motion vector detection operation over a relatively small detection region but with a relatively fine resolution. The motion vector detection device 900 is arranged so that the relatively large detection region of the first motion vector detection circuit 915 includes the relatively small detection region of the second motion vector detection circuit 916. Thus, a motion vector for a relatively fast movement is detected by the first motion vector detection circuit 915 having the relatively large detection region, whereas a motion vector for a relatively slow movement is detected by both of the two motion vector detection circuits (i.e., by the first motion vector detection circuit 915 having the relatively large detection region and by the second motion vector detection circuit 916 having the relatively small detection region). The values of correlation detected by the respective detectors- are compared with each other by a comparator 917, thereby increasing the precision with which a motion vector for a relatively slow movement is detected.
However, this conventional technique requires the two different motion vector detection circuits 915 and 916, thereby increasing the size and complexity of the entire circuit.
As described above, conventional motion vector detection devices had a limited search region. One conventional solution to this problem was the motion vector detection device 900 illustrated in FIG. 9 which includes two different motion vector detection circuits, one for a relatively fine resolution and another for a relatively coarse resolution, in order to expand the search region.
However, the motion vector detection device 900 requires the two different motion vector detection circuits 915 and 916, thereby increasing the scale of the entire circuit. The increase in the circuit scale may present a potentially serious problem particularly for motion vector detection based on the block matching method, in which the optimal position (the optimal motion vector) is detected by accumulating the difference between each pixel in the encoded object block and the corresponding pixel in each of a plurality of candidate blocks over an entire search region.
Moreover, it is expected that there will be a demand for a technique for detecting a motion of an image over an even larger search region in order to meet the existing demand for a higher definition and a higher image quality along with the increase in the size of the display screen.
In order to solve the above-described problems, the present invention provides a motion vector detection device in which a large search region is divided into a plurality of search regions and in which a motion vector with respect to one encoded object block is detected a plurality of times for each of the plurality of search regions. More specifically, the present invention provides a motion vector detection device capable of precisely detecting a motion vector for high image quality applications without substantially increasing the circuit scale, in which a single motion vector detection section may include a section for setting a plurality of parameters for a plurality of search regions, respectively, and a section for storing a plurality of motion vector detection results respectively corresponding to the search regions.
According to one aspect of this invention, there is provided a motion vector detection device, including: a parameter setting section having parameters relating to N (N is a natural number equal to or greater than 2) search regions obtained by dividing at least a portion of an entire search region in a search frame; a motion vector detection section for calculating an evaluation value which indicates a degree of correlation between an encoded object block in an object frame and a candidate block in one of the N search regions and for calculating a motion vector based on the evaluation value; a result storage section for storing the motion vector and the evaluation value calculated by the motion vector detection section; and a control section for controlling the motion vector detection section to calculate motion vectors and evaluation values for M (1xe2x89xa6Mxe2x89xa6N) different ones of the N search regions until a predetermined condition is satisfied, for receiving the motion vectors and the evaluation values from the result storage section, and for determining the motion vector for the encoded object block. Thus, it is possible to precisely detect a motion vector over a large search region despite a small circuit scale.
In one embodiment of the invention, the control section inputs parameters relating to the N search regions to the parameter setting section.
In one embodiment of the invention, M is equal to N.
In one embodiment of the invention, the result storage section stores N motion vectors and N evaluation values and then outputs the evaluation values and the motion vectors to the control section.
In one embodiment of the invention, the parameters relating to each search region include search position which indicates a position of a search region.
In one embodiment of the invention, the parameters relating to each search region include search size which indicates a size of a search region.
In one embodiment of the invention, the parameters relating to each search region include sub-sampling which indicates a degree and a direction of decimation in the search region.
In one embodiment of the invention, the parameters relating to each search region include a priority which indicates a predetermined value to be added to or multiplied by the evaluation value.
In one embodiment of the invention, a search region horizontally shifted from a center of the entire search region has a priority higher than that of a search region vertically shifted from the center of the entire search region.
In one embodiment of the invention, the parameters relating to each search region include order of search which indicates an order in which the calculation of the motion vector and the evaluation value is performed.
In one embodiment of the invention, a search region horizontally shifted from a center of the entire search region has an order of search higher than that of a search region vertically shifted from the center of the entire search region.
In one embodiment of the invention, the parameters relating to each search region include at least two of search position, search size, sub-sampling, priority and order of search.
In one embodiment of the invention, the predetermined condition is that the evaluation value being smaller than a predetermined value which the control section has.
In one embodiment of the invention, the predetermined condition is limited by a predetermined amount of time.
In one embodiment of the invention, N is 2.
In one embodiment of the invention, N is 3.
In one embodiment of the invention, the at least a portion of the entire search region is divided only along the vertical direction.
In one embodiment of the invention, the at least a portion of the entire search region is divided only along the horizontal direction.
In one embodiment of the invention, the at least a portion of the entire search region is divided into elliptical search regions.
In one embodiment of the invention, each of the elliptical search regions is longer in the horizontal direction than in the vertical direction.
In one embodiment of the invention, the at least a portion of the entire search region is divided into rectangular search regions.
In one embodiment of the invention, the N search regions are such that no candidate block included in one of the N search regions has a complete overlap with another candidate block which is included in another one of the N search regions.
In one embodiment of the invention, at least two of the N search regions have different search sizes.
In one embodiment of the invention, at least two of the N search regions have different sizes, and a search region having a larger size surrounds a search region having a smaller size.
In one embodiment of the invention, one of the N search regions including a center of the entire search region has the smallest size.
In one embodiment of the invention, one or more of the N search regions along a periphery of the entire search region has the largest size.
In one embodiment of the invention, the at least a portion of the entire search region is rectangular, and one or more of the N search regions at corners of the at least a portion of the entire search region has the largest size.
In one embodiment of the invention, at least two of the N search regions have different priorities.
In one embodiment of the invention, one of the N search regions including a center of the entire search region has the lowest priority.
In one embodiment of the invention, one or more of the N search regions along a periphery of the entire search region has the highest priority.
In one embodiment of the invention, the at least a portion of the entire search region is rectangular, and one or more of the N search regions at corners of the at least a portion of the entire search region has the highest priority.
In one embodiment of the invention, at least two of the N search regions have different sub-sampling parameters.
In one embodiment of the invention, a search region vertically shifted from a center of the entire search region is sub-sampled in the vertical direction.
In one embodiment of the invention, a search region horizontally shifted from a center of the entire search region is sub-sampled in the horizontal direction.
In one embodiment of the invention, one or more of the N search regions along a periphery of the entire search region has the largest sub-sampling parameter.
In one embodiment of the invention, the at least a portion of the entire search region is rectangular, and one or more of the N search regions at corners of the at least a portion of the entire search region has the largest sub-sampling parameter.
According to another aspect of this invention, there is provided a motion vector detection method, including: an input step of inputting parameters relating to N (N is a natural number equal to or greater than 2) search regions obtained by dividing at least a portion of an entire search region in a search frame to a motion vector detection section; a calculation step of calculating an evaluation value which indicates a degree of correlation between an encoded object block in an object frame and a candidate block in one of the N search regions based on the parameters of the one of the N search regions, and calculating a motion vector based on the evaluation value; and a determination step of determining whether a predetermined condition is satisfied based on the calculated evaluation values and motion vectors.
In one embodiment of the invention, the motion vector detection method further includes the step of terminating the motion vector calculation when the predetermined condition is satisfied.
In one embodiment of the invention, the motion vector detection method further includes the step of repeating the input step and the calculation step when the predetermined condition is not satisfied.
Thus, the invention described herein makes possible the advantage of providing a motion vector detection device capable of detecting a motion vector with a high precision to realize a high image quality without increasing the circuit scale.